package com.sinosoft.ebusiness.domain.elementManage;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class GeProductPageViewItemId implements Serializable {
	

	/**
	 * 
	 */
	private static final long serialVersionUID = 580949012183232524L;

	private String itemCode;
	
	private String groupcode;
	
	private String templateCode;

	@Column(name = "ITEMCODE")
	public String getItemCode() {
		return itemCode;
	}

	public void setItemCode(String itemCode) {
		this.itemCode = itemCode;
	}

	@Column(name = "GROUPCODE")
	public String getGroupcode() {
		return groupcode;
	}

	public void setGroupcode(String groupcode) {
		this.groupcode = groupcode;
	}
	@Column(name = "TEMPLATECODE")
	public String getTemplateCode() {
		return templateCode;
	}

	

	public void setTemplateCode(String templateCode) {
		this.templateCode = templateCode;
	}
	public boolean equals(Object other) {
		if ((this == other)) {
			return true;
		}
		if ((other == null)) {
			return false;
		}
		if (!(other instanceof GeProductPageViewItemId)) {
			return false;
		}
		GeProductPageViewItemId castOther = (GeProductPageViewItemId) other;

		return ((this.getItemCode() == castOther.getItemCode()) || (this
				.getItemCode() != null && castOther.getItemCode() != null && this
				.getItemCode().equals(castOther.getItemCode())))
				&& ((this.getGroupcode() == castOther.getGroupcode()) || (this
						.getGroupcode() != null
						&& castOther.getGroupcode() != null && this
						.getGroupcode().equals(castOther.getGroupcode())))
				&& ((this.getTemplateCode() == castOther.getTemplateCode()) || (this
						.getTemplateCode() != null && castOther.getTemplateCode() != null && this
						.getTemplateCode().equals(castOther.getTemplateCode())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getGroupcode() == null ? 0 : this.getGroupcode().hashCode());
		result = 37
				* result
				+ (getTemplateCode() == null ? 0 : this.getTemplateCode()
						.hashCode());
		result = 37
				* result
				+ (getGroupcode() == null ? 0 : this.getGroupcode()
						.hashCode());
		return result;
	}
	
	
}
